/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022.
 * Description: support ext4 error notify.
 * Author: lvhaoyu
 * Create: 2022-3-8
 */

#ifndef _RTOS_EXT4_ERROR_NOTIFY
#define _RTOS_EXT4_ERROR_NOTIFY

#include <linux/notifier.h>
#include <linux/spinlock_types.h>
#include <linux/time64.h>
#include <linux/types.h>

struct rtos_ext4_notify_info {
	char device_name[32];
	int error_count;
	int last_error_code;
	__u32 last_error_line;
	__u32 last_error_ino;
	__u64 last_error_block;
	const char *last_error_func;
	time64_t last_error_time;
};

extern int rtos_ext4_error_notifier_register(struct notifier_block *nb);
extern int rtos_ext4_error_notifier_unregister(struct notifier_block *nb);
#endif
